<%@ include file="../common/base.jsp" %>
<%@ page contentType= "text/html;charset=utf-8" %>
<%@ page language="java" import="com.octopus.optiworks.model.Product"%>
<%@ page language="java" import="com.octopus.optiworks.service.ConfigurationService"%>
<% Product product = (Product)request.getAttribute("product"); %>
<% boolean isAutoOperatorDate = ConfigurationService.getInstance().isAutoOpeartorDate() ; %>

<% if(product.getStep80Datas().size() > 0){ %>
<c:forEach var="step80Data" varStatus="status" items="${product.step80Datas}">
<c:if test="${not empty step80}">
<input type="hidden" name="id" value="<c:out value="${step80Data.id}" />">
<input type="hidden" name="product" value="<c:out value="${step80Data.product.id}" />">
<input type="hidden" name="className" value="com.octopus.optiworks.model.Step80Data">
<input type="hidden" name="step" value="step80">
<table width="100%">
	<tr>
		<td align="left" width="50%">
			<strong style="color:#A0A0FF">Step 80 焊前半成品测试 (MPI: ZY-60-087)</strong>
		</td>
		<td align="right" width="50%">
			<strong style="color:#A0A0FF">测试用光源编号:
				<c:if test="${not empty step80Data.testLightCode}">
					<input type="text" name="testLightCode" value="<c:out value="${step80Data.testLightCode}" />">
				</c:if>
				<c:if test="${empty step80Data.testLightCode}">
					<input type="text" name="testLightCode" value="<c:out value="${currentUser.testLightCode}" />">
				</c:if>
			</strong>
		</td>
	</tr>
</table>
<table rules="all" width="100%">
	<tr bgcolor="#F0F0FF">
		<td>
		</td>
		<td>
			透射IL
		</td>
		<td>
			透射Ripple
		</td>
		<td>
			透射隔离度
		</td>
		<td>
			DCWL
		</td>
		<td>
			PBW
		</td>
		<td>
			反射隔离度
		</td>
		<td colspan="2">
			反射Ripple
		</td>
	</tr>
	<tr bgcolor="#F0F0FF">
		<td>
			23摄氏度
		</td>
		<td>
			<input type="text" name="transIl" size="3" value="<c:out value="${step80Data.transIl}" />">
		</td>
		<td>
			<input type="text" name="transRipple" size="3" value="<c:out value="${step80Data.transRipple}" />">
		</td>
		<td>
			<input type="text" name="transHeight" size="3" value="<c:out value="${step80Data.transHeight}" />">
		</td>
		<td>
			<input type="text" name="dcwl" size="3" value="<c:out value="${step80Data.dcwl}" />">
		</td>
		<td>
			<input type="text" name="pbw" size="3" value="<c:out value="${step80Data.pbw}" />">
		</td>
		<td>
			<input type="text" name="reflectHeight" size="3" value="<c:out value="${step80Data.reflectHeight}" />">
		</td>
		<td colspan="2">
			<input type="text" name="refectRipple" size="3" value="<c:out value="${step80Data.refectRipple}" />">
		</td>
	</tr>
	<tr bgcolor="#F0F0FF">
		<td>
		</td>
		<td>
			RL(R-Port)
		</td>
		<td>
			RL(C-Port)
		</td>
		<td>
			Dir(P->R)
		</td>
		<td>
			Dir(R->P)
		</td>
		<td>
			反射IL/PDL
		</td>
		<td>
			反射IL(高温)/PDL
		</td>
		<td>
			透射PDL
		</td>
		<td>
			Operator/Date
		</td>
	</tr>
	<tr bgcolor="#F0F0FF">
		<td>
			atAdj_L
		</td>
		<td>
			<input type="text" name="rlRportParm1" size="3" value="<c:out value="${step80Data.rlRportParm1}" />">
		</td>
		<td>
			<input type="text" name="rlCportParm1" size="3" value="<c:out value="${step80Data.rlCportParm1}" />">
		</td>
		<td>
			N/A
		</td>
		<td>
			<input type="text" name="dirRpParm1" size="3" value="<c:out value="${step80Data.dirRpParm1}" />">
		</td>
		<td>
			<input type="text" name="reflectIlpdl" size="3" value="<c:out value="${step80Data.reflectIlpdl}" />">
		</td>
		<td>
			<input type="text" name="reflectIlpdlHigh" size="3" value="<c:out value="${step80Data.reflectIlpdlHigh}" />">
		</td>
		<td>
			<input type="text" name="transPdl" size="3" value="<c:out value="${step80Data.transPdl}" />">
		</td>
		<td>
			<% if(isAutoOperatorDate){ %>
			<c:out value="${step80Data.operator}" />
			/
			<fmt:formatDate  value="${step80Data.date}" pattern="yyyy-MM-dd HH:mm"/>
			<% }else{ %>
			<select name="operator">
				<c:forEach var="user" items="${users}">
				<option value="<c:out value="${user.username}" />" 
				<c:if test="${(null==step80Data.operator && user.username==currentUser.username) || (null!=step80Data.operator && user.username==step80Data.operator)}">
				selected="selected"
				</c:if>
				><c:out value="${user.username}" /></option>
				</c:forEach>
				</select>
				/<br>
				<input type="text" name="date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step80Data.date}" pattern="yyyy-MM-dd HH:mm"/>">
			<% } %>
		</td>
	</tr>
	<tr>
		<td bgcolor="#F0F0FF">
			atITU
		</td>
		<td bgcolor="#F0F0FF">
			N/A
		</td>
		<td bgcolor="#F0F0FF">
			<input type="text" name="rlCportParm2" size="3" value="<c:out value="${step80Data.rlCportParm2}" />">
		</td>
		<td bgcolor="#F0F0FF">
			<input type="text" name="dirPrParm2" size="3" value="<c:out value="${step80Data.dirPrParm2}" />">
		</td>
		<td bgcolor="#F0F0FF">
			N/A
		</td>
		<% if(product.getStep70Datas().size() > 0 ){ %>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<c:if test="${status.index == status7.index}">
		<td colspan="2" rowspan="2">
			<strong>Step 70 循环I (MPI: ZY-60-094)</strong>
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step70 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step70">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
		</td>
		<td>
			进循环时间：
			<!--  
			<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd"/>
			-->
		</td>
		<td>
			<!--  
			<c:out value="${step70Data.timeBegin}" />
			-->
			<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:if>
		</c:forEach>
		<% } else {%>
		<td colspan="4" rowspan="2" bgcolor="#F0F0FF">
		<% }%>
	</tr>
	<tr>
		<td bgcolor="#F0F0FF">
			atAdj_R
		</td>
		<td bgcolor="#F0F0FF">
			<input type="text" name="rlRportParm3" size="3" value="<c:out value="${step80Data.rlRportParm3}" />">
		</td>
		<td bgcolor="#F0F0FF">
			<input type="text" name="rlCportParm3" size="3" value="<c:out value="${step80Data.rlCportParm3}" />">
		</td>
		<td bgcolor="#F0F0FF">
			N/A
		</td>
		<td bgcolor="#F0F0FF">
			<input type="text" name="dirRpParm3" size="3" value="<c:out value="${step80Data.dirRpParm3}" />">
		</td>
		<% if(product.getStep70Datas().size() > 0 ){ %>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<c:if test="${status.index == status7.index}">
		<td>
			出循环时间：
			<!--  
			<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd"/>
			-->
		</td>
		<td>
			<!--  
			<c:out value="${step70Data.timeEnd}" />
			-->
			<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:if>
		</c:forEach>
		<% }%>
	</tr>
</table>
<table width="100%" bgcolor="#F0F0FF">
	<tr>
		<td align="right">
			<fmt:message key="label.common.testresult" />
			<c:if test="${step80Data.testResult=='Spec' || empty step80Data.testResult}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_SPEC %>" checked><fmt:message key="label.common.specauto" />
			</c:if>
			<c:if test="${step80Data.testResult!='Spec' && not empty step80Data.testResult}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_SPEC %>" ><fmt:message key="label.common.specauto" />
			</c:if>
			<c:if test="${step80Data.testResult=='Pass'}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_PASS %>" checked><fmt:message key="label.common.pass" />
			</c:if>
			<c:if test="${step80Data.testResult!='Pass'}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_PASS %>" ><fmt:message key="label.common.pass" />
			</c:if>
			<c:if test="${step80Data.testResult=='Waive'}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_WAIVE %>" checked><fmt:message key="label.common.waive" />
			</c:if>
			<c:if test="${step80Data.testResult!='Waive'}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_WAIVE %>" ><fmt:message key="label.common.waive" />
			</c:if>
			<c:if test="${step80Data.testResult=='Fail'}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_FAILURE %>" checked><fmt:message key="label.common.fail" />
			</c:if>
			<c:if test="${step80Data.testResult!='Fail'}">
				<input type="radio" name="<%= StepActionUtil.TESTRESULT %>" value="<%= StepActionUtil.TESTRESULT_FAILURE %>" ><fmt:message key="label.common.fail" />
			</c:if>
		</td>
	</tr>
</table>
</c:if>

<c:if test="${empty step80}">
<table width="100%">
	<tr>
		<td align="left" width="50%">
			<strong>Step 80 焊前半成品测试 (MPI: ZY-60-087)</strong>
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step80 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step80">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
		</td>
		<td align="right" width="50%">
			<strong>测试用光源编号:<c:out value="${step80Data.testLightCode}" /></strong>
		</td>
	</tr>
</table>
<table rules="all" width="100%">
	<tr>
		<td width="10%">
		</td>
		<td width="10%">
			透射IL
		</td>
		<td width="10%">
			透射Ripple
		</td>
		<td width="10%">
			透射隔离度
		</td>
		<td width="10%">
			DCWL
		</td>
		<td width="10%">
			PBW
		</td>
		<td width="15%">
			反射隔离度
		</td>
		<td colspan="2">
			反射Ripple
		</td>
	</tr>
	<tr>
		<td>
			23摄氏度
		</td>
		<td>
			<c:out value="${step80Data.transIl}" />
		</td>
		<td>
			<c:out value="${step80Data.transRipple}" />
		</td>
		<td>
			<c:out value="${step80Data.transHeight}" />
		</td>
		<td>
			<c:out value="${step80Data.dcwl}" />
		</td>
		<td>
			<c:out value="${step80Data.pbw}" />
		</td>
		<td>
			<c:out value="${step80Data.reflectHeight}" />
		</td>
		<td colspan="2">
			<c:out value="${step80Data.refectRipple}" />
		</td>
	</tr>
	<tr>
		<td>
		</td>
		<td>
			RL(R-Port)
		</td>
		<td>
			RL(C-Port)
		</td>
		<td>
			Dir(P->R)
		</td>
		<td>
			Dir(R->P)
		</td>
		<td>
			反射IL/PDL
		</td>
		<td>
			反射IL(高温)/PDL
		</td>
		<td width="12%">
			透射PDL
		</td>
		<td>
			Operator/Date
		</td>
	</tr>
	<tr>
		<td>
			atAdj_L
		</td>
		<td>
			<c:out value="${step80Data.rlRportParm1}" />
		</td>
		<td>
			<c:out value="${step80Data.rlCportParm1}" />
		</td>
		<td>
			N/A
		</td>
		<td>
			<c:out value="${step80Data.dirRpParm1}" />
		</td>
		<td>
			<c:out value="${step80Data.reflectIlpdl}" />
		</td>
		<td>
			<c:out value="${step80Data.reflectIlpdlHigh}" />
		</td>
		<td>
			<c:out value="${step80Data.transPdl}" />
		</td>
		<td>
			<c:out value="${step80Data.operator}" />
			/
			<fmt:formatDate  value="${step80Data.date}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
	</tr>
	<tr>
		<td>
			atITU
		</td>
		<td>
			N/A
		</td>
		<td>
			<c:out value="${step80Data.rlCportParm2}" />
		</td>
		<td>
			<c:out value="${step80Data.dirPrParm2}" />
		</td>
		<td>
			N/A
		</td>
		<% if(product.getStep70Datas().size() > 0 ){ %>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<c:if test="${status.index == status7.index}">
		<td colspan="2" rowspan="2" <c:if test="${not empty step70}">bgcolor="#F0F0FF"</c:if>>
			<strong <c:if test="${not empty step70}">style="color:#A0A0FF"</c:if>>Step 70 循环I (MPI: ZY-60-094)</strong>
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step70 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step70">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
		</td>
		<c:if test="${not empty step70}">
		<input type="hidden" name="id" value="<c:out value="${step70Data.id}" />">
		<input type="hidden" name="product" value="<c:out value="${step70Data.product.id}" />">
		<input type="hidden" name="className" value="com.octopus.optiworks.model.Step70Data">
		<input type="hidden" name="step" value="step70">
		<td bgcolor="#F0F0FF">
			进循环时间：
			<!--  
			<input type="text" name="dateBegin" size="3" value="<c:out value="${step70Data.dateBegin}" />">
			-->
		</td>
		<td bgcolor="#F0F0FF">
			<!--
			<input type="text" name="timeBegin" size="3" value="<c:out value="${step70Data.timeBegin}" />">
			-->
			<input type="text" name="dateBegin" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd HH:mm"/>">
		</td>
		</c:if>
		<c:if test="${empty step70}">
		<td>
			进循环时间：
			<!--  
			<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd"/>
			-->
		</td>
		<td>
			<!--  
			<c:out value="${step70Data.timeBegin}" />
			-->
			<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:if>
		</c:if>
		</c:forEach>
		<% }else { %>
		<td colspan="4" rowspan="2"></td>
		<% } %>
	</tr>
	<tr>
		<td>
			atAdj_R
		</td>
		<td>
			<c:out value="${step80Data.rlRportParm3}" />
		</td>
		<td>
			<c:out value="${step80Data.rlCportParm3}" />
		</td>
		<td>
			N/A
		</td>
		<td>
			<c:out value="${step80Data.dirRpParm3}" />
		</td>
		<% if(product.getStep70Datas().size() > 0 ){ %>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<c:if test="${status.index == status7.index}">
		<c:if test="${not empty step70}">
		<td bgcolor="#F0F0FF">
			出循环时间：
			<!--  
			<input type="text" name="dateEnd" size="3" value="<c:out value="${step70Data.dateEnd}" />">
			-->
		</td>
		<td bgcolor="#F0F0FF">
			<!--  
			<input type="text" name="timeEnd" size="3" value="<c:out value="${step70Data.timeEnd}" />">
			-->
			<input type="text" name="dateEnd" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd HH:mm"/>">
		</td>
		</c:if>
		<c:if test="${empty step70}">
		<td>
			出循环时间：
			<!--  
			<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd"/>
			-->
		</td>
		<td>
			<!--  
			<c:out value="${step70Data.timeEnd}" />
			-->
			<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:if>
		</c:if>
		</c:forEach>
		<% } %>
	</tr>
</table>
<table width="100%">
	<tr>
		<td align="right">
			测试结果:
			<c:out value="${step80Data.testResult}" />
		</td>
	</tr>
</table>
</c:if>
</c:forEach>

<% }else if(product.getStep70Datas().size() > 0 ){ %>
<table rules="all" width="100%">
<c:if test="${not empty step70}">
	<tr>
		<td rowspan="2" width="30%" bgcolor="#F0F0FF">
			<strong style="color:#A0A0FF">Step 70 循环I (MPI: ZY-60-094)</strong>
		</td>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<input type="hidden" name="id" value="<c:out value="${step70Data.id}" />">
		<input type="hidden" name="product" value="<c:out value="${step70Data.product.id}" />">
		<input type="hidden" name="className" value="com.octopus.optiworks.model.Step70Data">
		<input type="hidden" name="step" value="step70">
		<td bgcolor="#F0F0FF">
			进循环时间：
			<!--  
			<input type="text" name="dateBegin" size="3" value="<c:out value="${step70Data.dateBegin}" />">
			-->
		</td>
		<td width="30%" bgcolor="#F0F0FF">
			<!--  
			<input type="text" name="timeBegin" size="3" value="<c:out value="${step70Data.timeBegin}" />">
			-->
			<input type="text" name="dateBegin" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd HH:mm"/>">
		</td>
		</c:forEach>
	</tr>
	<tr>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<td bgcolor="#F0F0FF">
			出循环时间：
			<!--  
			<input type="text" name="dateEnd" size="3" value="<c:out value="${step70Data.dateEnd}" />">
			-->
		</td>
		<td bgcolor="#F0F0FF">
			<!--  
			<input type="text" name="timeEnd" size="3" value="<c:out value="${step70Data.timeEnd}" />">
			-->
			<input type="text" name="dateEnd" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd HH:mm"/>">
		</td>
		</c:forEach>
	</tr>
</c:if>
<c:if test="${empty step70}">
	<tr>
		<td rowspan="2" width="30%">
			<strong>Step 70 循环I (MPI: ZY-60-094)</strong>
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step70 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step70">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
		</td>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<td>
			进循环时间：
			<!--  
			<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd"/>
			-->
		</td>
		<td width="30%">
			<!--  
			<c:out value="${step70Data.timeBegin}" />
			-->
			<fmt:formatDate  value="${step70Data.dateBegin}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:forEach>
	</tr>
	<tr>
		<c:forEach var="step70Data" varStatus="status7" items="${product.step70Datas}">
		<td>
			出循环时间：
			<!--  
			<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd"/>
			-->
		</td>
		<td>
			<!--  
			<c:out value="${step70Data.timeEnd}" />
			-->
			<fmt:formatDate  value="${step70Data.dateEnd}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:forEach>
	</tr>
</c:if>
</table>
<% } %>